﻿
///---------------------------
///2012.10.5 汪定新添加
//双击事件
function CustomDbClick() {
    parent.closeWin(); //去掉双击功能
}

//添加信息
var fnCustomAdd = function () {
    const_EditEntity = "SysModuleHelp";
    var pagetitle = "新增模块帮助";
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&fun=add"));
    parent.NeedRefreshPage = this;
}

//修改信息
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    const_EditEntity = "SysModuleHelp";
    var pagetitle = "修改模块帮助信息—" + record.getData("Name");
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID)+ "&fun=edit"));
    parent.NeedRefreshPage = this;
}
//查看
var fnView = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var id = record.getData(const_entityID);
    var pagetitle = "查看帮助信息—" + record._oData["Name"];
    parent._employeeTitle = pagetitle;
    parent.addTabs(pagetitle, encodeURI("../Extend/Edit.aspx?r=" + Math.random() + "&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID) + "&fun=view"));
    parent.NeedRefreshPage = this;
}

//单元格格式化
var fnFormater = function (elCell, oRecord, oColumn, sData) {
    //elCell.innerHTML = oRecord.getData("DeptName");
    var cellValue = sData;
    if (cellValue != null && cellValue.length > 20) {
        cellValue = cellValue.substr(0, 20) + "...";
    }
    elCell.innerHTML = "<div title='" + sData + "'>" + cellValue + "</div>";
}